package com.xiyuan.properties;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource("classpath:token.properties")
public class JwtProperties {

    /**
     * 用户生成jwt令牌相关配置
     */
    @Value("${token.secret}")
    private String secret;
    @Value("${token.expireTime}")
    private long expireTime;
    @Value("${token.header}")
    private String header;

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(long expireTime) {
        this.expireTime = expireTime;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    @Override
    public String toString() {
        return "JwtProperties{" +
                "secret='" + secret + '\'' +
                ", expireTime=" + expireTime +
                ", header='" + header + '\'' +
                '}';
    }
}
